package com.mspbots.attendance.controller;


import com.mspbots.attendance.model.TenantAttendanceApprove;
import com.mspbots.attendance.service.TenantAttendanceApproveService;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.Callable;

@Log4j2
@RestController
@RequestMapping("tenantattendancesapprove")
public class TenantAttendanceApproveController {
    private final TenantAttendanceApproveService tenantAttendanceApproveService;

    public TenantAttendanceApproveController(TenantAttendanceApproveService tenantAttendanceApproveService) {
        this.tenantAttendanceApproveService = tenantAttendanceApproveService;
    }


    @PostMapping("updatemodify")
    public Callable saveApprove(@RequestBody TenantAttendanceApprove tenantAttendanceApprove) {
        return () -> tenantAttendanceApproveService.saveApprove(tenantAttendanceApprove);
    }

    @PostMapping("updateapprove")
    public Callable updateApprove(@RequestBody TenantAttendanceApprove tenantAttendanceApprove) {
        return () -> tenantAttendanceApproveService.updateApprove(tenantAttendanceApprove);
    }

}
